package top.hmtools.ckfinder.configuration;

import javax.annotation.PostConstruct;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@ComponentScan(basePackages={"top.hmtools.ckfinder.controller"})
@Import(FileAdapterConfigurationImportSelector.class)
public class CKFinderAutoConfiguration implements ApplicationContextAware{
	
	private ApplicationContext applicationContext;
	
	public static final String prefix = "hm_tools.ckfinder.";

	public static final String URI = prefix+"uri";
	
	@Autowired
	private BaseCommandConfig abstractConfig;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}
	
	@PostConstruct
	public void init(){
		abstractConfig.init();
		System.out.println("&&&&&&    CKFinderAutoConfiguration is inited ");
	}

}
